package com.hliushi.strategy;

import com.hliushi.domain.Elevator;
import com.hliushi.domain.ExternalRequest;
import org.apache.commons.collections4.CollectionUtils;

import java.util.List;

/**
 * @author: hliushi
 * @date: 2023/2/18 22:12
 **/
public interface RequestStrategy {

    void doHandleExternalRequest(ExternalRequest request, List<Elevator> elevatorList);


    default void validate(List<Elevator> elevatorList) {
        if (CollectionUtils.isEmpty(elevatorList)) {
            throw new RuntimeException("no available Elevator");
        }
    }
}
